.TH rtapi_task_self "3rtapi" "2015-04-18" "LinuxCNC Documentation" "RTAPI"
.SH NAME

rtapi_task_self \- Retrieve ID of current task

.SH SYNTAX
.HP
void rtapi_task_self()

.SH DESCRIPTION
\fBrtapi_task_self\fR retrieves the current task, or -EINVAL if not in a
realtime task (e.g., in startup or shutdown code).

.SH REALTIME CONSIDERATIONS
May be called from init/cleanup code, and from within realtime tasks.

.SH RETURN VALUE
The task number previously returned by \fBrtapi_task_new\fR or -EINVAL.

.SH SEE ALSO
\fBrtapi_task_new(3rtapi)\fR
